package com.dianqiu.batch.action;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.dianqiu.base.action.BatchBaseAction;

public class CrawlerConsoleAction extends BatchBaseAction {
	private static Logger logger = LoggerFactory.getLogger(CrawlerConsoleAction.class);
	private static final long serialVersionUID = 1L;
	private static final String URL = "http://sports.sina.com.cn/live/";
	private static final String USER_AGENT = "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.15)";
	private static final int TIME_OUT = 100000;
	

	public String crawl(){
		try {
			logger.info("Begin to crawl match info");
			getSinaCrawlerService().crawl(URL, USER_AGENT, TIME_OUT);
			logger.info("End to crawl match info");
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return ERROR;
		}
		return SUCCESS;
	}
	
}
